package io.char_stream;

import java.io.FileReader;
import java.io.IOException;

public class Demo01_FileReader {
    public static void main(String[] args) throws IOException {
        //extracted();

        FileReader fr = new FileReader("D:\\wangdao_study\\studyHard\\添狗.txt");

        int c;

        while ((c = fr.read()) != -1) {
            //通过项目默认的码表，一次读取一个字符
            System.out.println(((char) c));
        }

        fr.close();


    }

    private static void extracted() throws IOException {
        FileReader fr = new FileReader("D:\\wangdao_study\\studyHard\\添狗.txt");

        int x = fr.read();
        char c = (char) x;
        System.out.println(c);
    }
}
